
from httpx import AsyncClient, Limits
from pybotx import Bot, CallbackRepoProto

from app.settings import settings
BOTX_CALLBACK_TIMEOUT = 30


def get_bot(callback_repo: CallbackRepoProto, raise_exceptions: bool) -> Bot:

    return Bot(
        collectors=[],
        bot_accounts= settings.BOT_CREDENTIALS,
        default_callback_timeout=BOTX_CALLBACK_TIMEOUT, 
        httpx_client=AsyncClient(
            timeout=60,
            limits=Limits(max_keepalive_connections=None, max_connections=None)
        ),
        middlewares=[],
        callback_repo=callback_repo
    ) 